package day04;

public class Student {
	private String name;
	private int age;

	public Student() {
		name = "韩非";
		System.out.println("构造器被调用了");
	}

	public Student(String name) {
		this.name = name;
		System.out.println("第二个构造器被调用了");
	}

	public Student(String name, int age) {
		this.name = name;
		this.age = age;
		System.out.println("第三个构造器被调用了");
	}

	public void speak(String msg) {
		System.out.println(msg);
	}
	public static void main(String[] args) {
		//Student a = new Student("卢本伟");
		//Student b = new Student();
		//System.out.println(b.name);
//		Student c = new Student("熊自仁",21);
//		System.out.println(c.name);
//		System.out.println(c.age);
		Student d = new Student();
		System.out.println(d.name);
		System.out.println(d.age);
		d.speak("面向对象并不简单");
	}
}
